package ru.sgu.codecenter.fidx.command;

import ru.sgu.codecenter.fidx.model.Engine;
import ru.sgu.codecenter.fidx.model.HelpItem;

import java.util.List;

public abstract class Command {
    protected Engine engine;

    public abstract String getName();
    public abstract void execute(String[] args);
    public abstract List<HelpItem> getHelpItems();

    public void setEngine(Engine engine) {
        this.engine = engine;
    }

    public static void info(String message) {
        log("INFO", message);
    }

    public static void warn(String message) {
        log("WARN", message);
    }

    public static void error(String message) {
        log("ERROR", message);
    }

    public static void log(String type, String message) {
        System.out.println("[" + type + "] " + message);
    }
}
